package br.com.mucceli.politicapopular.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author mucceli
 */
@Entity
@Table(name = "ESCANDALO")
@NamedQueries({
    @NamedQuery(name = "Escandalo.findAll", query = "SELECT e FROM Escandalo e"),
    @NamedQuery(name = "Escandalo.findByIdEscandalo", query = "SELECT e FROM Escandalo e WHERE e.idEscandalo = :idEscandalo")})
public class Escandalo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_ESCANDALO")
    private Integer idEscandalo;
    @Basic(optional = false)
    @NotNull
    @Lob
    @Size(min = 1, max = 65535)
    @Column(name = "NOME")
    private String nome;
    @Basic(optional = false)
    @NotNull
    @Lob
    @Size(min = 1, max = 65535)
    @Column(name = "DESCRICAO")
    private String descricao;

    public Escandalo() {
    }

    public Escandalo(Integer idEscandalo) {
        this.idEscandalo = idEscandalo;
    }

    public Escandalo(Integer idEscandalo, String nome, String descricao) {
        this.idEscandalo = idEscandalo;
        this.nome = nome;
        this.descricao = descricao;
    }

    public Integer getIdEscandalo() {
        return idEscandalo;
    }

    public void setIdEscandalo(Integer idEscandalo) {
        this.idEscandalo = idEscandalo;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEscandalo != null ? idEscandalo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Escandalo)) {
            return false;
        }
        Escandalo other = (Escandalo) object;
        if ((this.idEscandalo == null && other.idEscandalo != null) || (this.idEscandalo != null && !this.idEscandalo.equals(other.idEscandalo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.mycompany.mavenproject1.Escandalo[ idEscandalo=" + idEscandalo + " ]";
    }
    
}
